﻿using Lis.DALFactory;
using Lis.IDAL;
using Lis.IRepository;
using Lis.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lis.Repository
{
    public class AppointmentInfoRepository : GenericRepository<AppointmentInfo>, IAppointmentInfoRepository
    {
        public override void GetDal()
        {
            CurrentDal = AbstractDalFactory.GetAppointmentInfoDal();
        }

        #region 01，根据馆藏号查询预约信息+IEnumerable<AppointmentInfo> GetEntitiesByBarCode(string BarCode,string UserName)
        /// <summary>
        /// 根据馆藏号查询预约信息
        /// </summary>
        /// <param name="BarCode">馆藏号</param>
        /// <returns></returns>
        public IEnumerable<AppointmentInfo> GetEntitiesByBarCode(string BarCode)
        {
            return ((IAppointmentInfoDal)CurrentDal).GetEntitiesByBarCode(BarCode);
        } 
        #endregion

        #region 02,根据读者卡号查询预约信息+IEnumerable<AppointmentInfo> GetEntitiesByUserName(string UserName)
        /// <summary>
        /// 根据读者卡号查询预约信息
        /// </summary>
        /// <param name="UserName">读者卡号</param>
        /// <returns></returns>
        public IEnumerable<AppointmentInfo> GetEntitiesByUserName(string UserName)
        {
            return ((IAppointmentInfoDal)CurrentDal).GetEntitiesByUserName(UserName);
        } 
        #endregion
    }
}
